check_ssh_dir:
  cmd.run:
    - names:
      - mkdir -p /root/.ssh
      - chmod 700 /root/.ssh
    - unless: test -d /root/.ssh

touch_keys:
  file.touch:
    - name: /root/.ssh/authorized_keys
    - unless: test -e /root/.ssh/authorized_keys
    - requires:
      - cmd.run: check_ssh_dir

/root/.ssh/authorized_keys:
  file.append:
    - text: 
        - "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA1RIGuDKyzqoYBLjZHX/sgzURvvf6U4b0XekgyKicjv5oKGyECXf0h0rDEjeOCdG/H1bfbp5pxvIAVtiyyOu0zqnbhA5ZKmZpGNNXIgLC7JqtqdkI9C88e2UzobFYzY6c5dgEIrDFkJggUcuQ2x21n9J29XTDcBPnSGhYC/dt7uhuK73fEootGZkBrk4Z1tIRKUEZEYIaxwih2KWvLHJIB747Vk0N943eUkuNxAWsGSp4G1NniIe21g8L43g81JAph4bvsnYqlMeEroGdHYkFmi1uM+AwLqxw8Tgz6Qynwix47mrJMZkkijutQj1I0yJumKsuzgbw/jNq0SCteybdUQ== root@vm-frontree"
        - "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA40IO/+rgK4XZm2fmGAnv3vtSsgiHRR8rIJ1OS84tnDdgIu7yT7UsILEWsnfx0R5WsU6oEQjJkQpnUOvn1waRvpVR6CIza+L7byBib/MW+VY8yar4J2qyuLp+pk9XAhXpyAQ5//3o6Tg9mQJ8l9jQiMULyLWMJxjGUScYzk5ODVM6jwKAwAFqmojk/Qzh5OxNre0ZtUmFfqFdjvmCO/MswLooEqJc+iic/ELGe7Xu3CWIpR+WpTYYtkfG+pzOHWnpofQ55HWeMfoSFj1gydutDY6RBPtkxv/aV0PYdEjHmHX6pZ7IP1MMEr+5ePHIW6gQBmT8MwGhx9BYLYL2Y0SvEQ== root@login1"
    - requires:
      - file: touch_keys


